<?php


function auto($className){
    $path=$className.'.php';
    $path=str_replace('\\',DIRECTORY_SEPARATOR,$path);
    if (file_exists($path)){
        include_once $path;
    }
}

spl_autoload_register('auto');

$m = new cat();
echo $m->name;